package com.scalosoft.action.hello;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.Result;

import com.opensymphony.xwork2.ActionSupport;


@SuppressWarnings("serial")

@Namespace(value="/hello")
public class HelloWorld extends ActionSupport {

	private static final String GREETING = "Ciao ";
	
	@Action(value="HelloWorld", results= {
			@Result(name="success",location="/hello/HelloWorld.jsp")
	})
    public String execute() {
    	setCustomGreeting( GREETING + getName() );
    	return SUCCESS;
    }

    private String name;
    
 
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    
    private String customGreeting;
    
    public String getCustomGreeting()
    {
    	return customGreeting;
    }
    
    public void setCustomGreeting( String customGreeting ){
    	this.customGreeting = customGreeting;
    }
}
